﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Kristall.Engine.Scripts
{
    public abstract class Script
    {
        public string Id { get; set; }

        public bool Enabled { get; set; }

        public event EventHandler<CollisionEventArgs> OnCollision;

        public void OnCollide(CollisionEventArgs collision)
        {
            if (OnCollision != null)
            {
                OnCollision(this, collision);
            }
        }

        public Script()
        {
            Enabled = true;
            Id = "not_set";
        }

        /*public Script(Script script)
        {
            this.Id = script.Id;
            this.Enabled = script.Enabled;
            this.OnCollision += script.OnCollision;
        }*/

        public virtual void Load(Level level, AABB aabb)
        {
        }

        public virtual void Update(float dt)
        {

        }
    }
}
